/*  1:   */ package org.jetbrains.jps.model.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.util.EventDispatcher;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsElement;
import org.jetbrains.jps.model.JpsElementChildRole;
import org.jetbrains.jps.model.JpsEventDispatcher;

import java.util.EventListener;
import java.util.HashMap;
import java.util.Map;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ public abstract class JpsEventDispatcherBase
/* 13:   */   implements JpsEventDispatcher
/* 14:   */ {
/* 15:32 */   private final Map<Class<?>, EventDispatcher<?>> a = new HashMap();
/* 16:   */   
/* 17:   */   @NotNull
/* 18:   */   public <T extends EventListener> T getPublisher(Class<T> paramClass)
/* 19:   */   {
/* 20:37 */     EventDispatcher localEventDispatcher = (EventDispatcher)this.a.get(paramClass);
/* 21:38 */     if (localEventDispatcher == null)
/* 22:   */     {
/* 23:39 */       localEventDispatcher = EventDispatcher.create(paramClass);
/* 24:40 */       this.a.put(paramClass, localEventDispatcher);
/* 25:   */     }
/* 26:43 */     EventListener tmp39_36 = localEventDispatcher.getMulticaster();
/* 27:43 */     if (tmp39_36 == null) {
/* 28:43 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsEventDispatcherBase", "getPublisher" }));
/* 29:   */     }
/* 30:43 */     return tmp39_36;
/* 31:   */   }
/* 32:   */   
/* 33:   */   public <T extends JpsElement> void fireElementAdded(@NotNull T paramT, @NotNull JpsElementChildRole<T> paramJpsElementChildRole)
/* 34:   */   {
/* 35:48 */     if (paramT == null) {
/* 36:48 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEventDispatcherBase", "fireElementAdded" }));
/* 37:   */     }
/* 38:48 */     if (paramJpsElementChildRole == null) {
/* 39:48 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/impl/JpsEventDispatcherBase", "fireElementAdded" }));
/* 40:   */     }
/* 41:48 */     paramJpsElementChildRole.fireElementAdded(this, paramT);
/* 42:   */   }
/* 43:   */   
/* 44:   */   public <T extends JpsElement> void fireElementRemoved(@NotNull T paramT, @NotNull JpsElementChildRole<T> paramJpsElementChildRole)
/* 45:   */   {
/* 46:53 */     if (paramT == null) {
/* 47:53 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEventDispatcherBase", "fireElementRemoved" }));
/* 48:   */     }
/* 49:53 */     if (paramJpsElementChildRole == null) {
/* 50:53 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/impl/JpsEventDispatcherBase", "fireElementRemoved" }));
/* 51:   */     }
/* 52:53 */     paramJpsElementChildRole.fireElementRemoved(this, paramT);
/* 53:   */   }
/* 54:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.impl.JpsEventDispatcherBase

 * JD-Core Version:    0.7.0.1

 */